<template>
  <view class="container">
	  <cu-custom bgColor="bg-white" :isBack="true">
	  	<block slot="backText">返回</block>
	  	<block slot="content"></block>
	  </cu-custom>
	  <view class="margin-top-xl padding">
		  <view class="text-center padding profile-rule" style="background-color: #3C96F3;">
			  <text class="text-lg text-white">个人信息</text>
		  </view>
		  <view style="border-color: black;border-radius: 16px 16px 0 0;" class="">
			  <uni-list style="background-color: #F3F4F6;">
			    <uni-list-item style="background-color: #F3F4F6;" showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
			    <uni-list-item style="background-color: #F3F4F6;" showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
			    <uni-list-item style="background-color: #F3F4F6;" showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
			    <uni-list-item style="background-color: #F3F4F6;" showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
			    <uni-list-item style="background-color: #F3F4F6;" showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
			    <uni-list-item style="background-color: #F3F4F6;" showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
			  </uni-list>
		  </view>
		  
	  </view>
    
  </view>
</template>

<script>
  import { getUserProfile } from "@/api/system/user"

  export default {
    data() {
      return {
        user: {},
        roleGroup: "",
        postGroup: ""
      }
    },
    onLoad() {
      this.getUser()
    },
    methods: {
      getUser() {
        getUserProfile().then(response => {
          this.user = response.data
          this.roleGroup = response.roleGroup
          this.postGroup = response.postGroup
        })
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #fff;
  }
  .profile-rule {
    height: 140rpx;
    line-height: 140rpx;
    padding: 0px 40rpx;
    // background-color: $u-main-color;
    border-radius: 16px 16px 0 0;
    // box-shadow: 0px 16px 26px rgba(0, 0, 0, .8);
  }
</style>
